#phase-diagram

import numpy as np
import pylab as pl
from pylab import *
import matplotlib.pyplot as pyplot

data11 = np.loadtxt('fig7a_MI_DW.dat')
data12 = np.loadtxt('fig7a_DS_BG.dat')
data13 = np.loadtxt('fig7a_SS.dat') 


data21 = np.loadtxt('fig7b_MI_DW.dat')
data22 = np.loadtxt('fig7b_DS.dat')
data23 = np.loadtxt('fig7b_SS.dat') 

fig1, axes = plt.subplots(nrows=2, ncols=1, figsize=(10,12))
pl.subplots_adjust(left=0.115, bottom=0.088, right=0.957, top=0.986, 
                   wspace=0.2, hspace=0.036)

#----------------------------subfigure 1---------------------------
plt.subplot(2,1,1)
rc('axes', linewidth=1)

pl.xlim(0, 0.09)
pl.ylim(0, 1.8)
pl.xticks([0,0.03,0.06,0.09],['','','',''], fontsize = 26)
pl.yticks([0,0.5,1,1.5],['0.0','0.5','1.0','1.5'], fontsize = 26)
pl.ylabel(r'$\mu/U$', fontsize=26, weight='bold',fontstyle='italic')
plt.text(0.018, 1.2, r'BG', color='black', fontsize = 26)
plt.text(0.018, 0.34, r'CDW', color='black', fontsize = 26)
plt.text(0.055, 0.40,r'SS', color='black', fontsize = 26)
plt.text(0.06, 1, r'SF', color='black', fontsize = 26)
plt.text(0.004, 0.75, r'DS', color='black', fontsize = 26)
plt.text(0.08, 1.66, r'(a)', color='black', fontsize = 26)
plt.text(0.0007, 1.25, r'MI', color='black', fontsize = 26)


ax = gca()

pl.plot(data11[:,0], data11[:,1], 'm-',linewidth=3.0)
pl.plot(data12[:,0], data12[:,1], 'g-',linewidth=3.0)
pl.plot(data13[:,0], data13[:,1], 'b-',linewidth=3.0)

#----------------------------subfigure 2---------------------------
plt.subplot(2,1,2)

pl.xlim(0, 0.09)
pl.ylim(0, 1.8)
pl.xticks([0,0.03,0.06,0.09],['0.0','0.03','0.06','0.09'], fontsize = 26)
pl.yticks([0,0.5,1,1.5],['0.0','0.5','1.0','1.5'], fontsize = 26)
pl.xlabel(r'$J/U$', fontsize=26, weight='bold',fontstyle='italic')
pl.ylabel(r'$\mu/U$', fontsize=26, weight='bold',fontstyle='italic')
#pl.title('$U_{12} = 0.3 U$', fontsize=18, weight='bold' )
plt.text(0.018, 1.45, r'MI', color='black', fontsize = 26)
plt.text(0.018, 0.52, r'CDW', color='black', fontsize = 26)
plt.text(0.06, 0.52,r'SS', color='black', fontsize = 20)
plt.text(0.06, 1, r'SF', color='black', fontsize = 26)
plt.text(0.018, 0.75, r'DS', color='black', fontsize = 24)
plt.text(0.018, 0.23, r'DS', color='black', fontsize = 24)
plt.text(0.002, 0.90, r'$\frac{3}{4}$DW', color='black', fontsize = 24)
plt.text(0.002, 0.10, r'$\frac{1}{4}$DW', color='black', fontsize = 24)
plt.text(0.08, 1.66, r'(b)', color='black', fontsize = 26)
ax = plt.gca()
ax.annotate('', xy=(0.06, 0.56), xytext=(0.053, 0.56),
            arrowprops=dict(facecolor='red', edgecolor='black', arrowstyle='->', lw=3))



ax = gca()

pl.plot(data21[:,0], data21[:,1], 'm-',linewidth=3.0)
pl.plot(data22[:,0], data22[:,1], 'g-',linewidth=3.0)
pl.plot(data23[:,0], data23[:,1], 'b-',linewidth=3.0)

fig1.savefig('phase-high-d-phase-nnn.pdf')
pl.show()
